package com.twu.biblioteca.command;

import com.twu.biblioteca.Book;
import com.twu.biblioteca.Library;

/**
 * Created with IntelliJ IDEA.
 * User: twer
 * Date: 5/29/13
 * Time: 11:59 PM
 * To change this template use File | Settings | File Templates.
 */
public class ViewAllBooksCommand implements Command {
    private Library library;

    public ViewAllBooksCommand(Library library){
        this.library = library;
    }

    @Override
    public String execute() {
        StringBuilder sb = new StringBuilder();
        for(Book book : library.getBooks()){
            sb.append("\t").append(book.getName()).append("\n");
        }
        return sb.toString();
    }
}
